package sctu.edu.java.year2016.team04.yanghuilin.day20160605.chapter11_2;

import java.util.Scanner;

/**
 * Created by dell on 2016/6/5.
 * 创建Number类，通过类中的count()方法可以得到任意两个数相乘的结果，并在调用该方法的主方法中使用
 * try...catch语句捕捉可能发生的异常。
 */
public class Num {

    void count() {
        Scanner scanner1 = new Scanner(System.in);
        Scanner scanner2 = new Scanner(System.in);

        System.out.println("Please enter the first number : ");
        float a = scanner1.nextFloat();

        System.out.println("Please enter the second number :");
        float b = scanner2.nextFloat();

        float p = a * b;
        System.out.println("The product is " + p);
    }
}
